package com.yang.scope;

import com.yang.autoConfig.Car;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        ApplicationContext ioc = new ClassPathXmlApplicationContext("beans-scope.xml");

        Car car = (Car) ioc.getBean("car");
        Car car1 = (Car) ioc.getBean("car");
        System.out.println(car == car1);
        //打印的结果为 true，说明是同一个对象
    }
}
